<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>带开关的时钟</title>
</head>
<body bgcolor="#c0c0c0">
	<h1>带开关的时钟</h1><hr>
	<script>
		var enabled = 0;
		function Tofunc() {
			TO = window.setTimeout("Tofunc()， 1000");
			var today = new Date();
			document.clock.disp.value = today.toLocaleString();
		}
	</script>
	<form id="clock" name="clock">
		<input type="text" name="disp" value="" size=30 onfocus="this.blur()">
		<input type="radio" name="rad" value="off" onclick="if(enabled==1) {
			document.clock.disp.value = '';
			clearTimeout(TO);
			enabled = 0;
		}" checked><font color="#ffff99">关</font>
		<input type="radio" name="rad" value="on" onclick="if(enabled==0) {
			var TO = setTimeout('Tofunc()', 1000);
			enable = 1;
		}"><font color="#ffff99">开</font>
	</form>
</body>
</html>